<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
		<!-- 引入样式 -->
		<link rel="stylesheet" href="../../plugins/element-ui/index.css" />
		<link rel="stylesheet" href="../../styles/common.css" />
		<link rel="stylesheet" href="../../styles/page.css" />
		<style>
			#member-app .notAdmin::after {
				border: 0 !important;

			}
		</style>
	</head>
	<body>
		<div class="dashboard-container" id="member-app">
			<img src="../../images/view.png" alt="" style="border: 3px solid white;">
			<div class="container">
				
				
				<el-table :data="tableData" stripe class="tableBox">
					<el-table-column prop="cfno" label="航班号"></el-table-column>
					<el-table-column prop="star" label="起始站"></el-table-column>
					<el-table-column prop="ends" label="终点站"></el-table-column>
					<el-table-column prop="startTime" align="center" label="起飞时间" width="180px"></el-table-column>
					<el-table-column prop="endTime" align="center" label="到达时间" width="180px"></el-table-column>
					<el-table-column align="center" label="航班状态">
						<template slot-scope="scope">
							<!-- {{ String(scope.row.status) === '0' ? '运行异常' : '运行正常' }} -->
							运行正常
						</template>
					</el-table-column>
					<el-table-column label="审核状态">

						  <template slot-scope="scope">
						    
						    <el-button
							v-if="scope.row.status === '0'"
						      size="mini"
						      type="danger"
						     >待审核</el-button>
							 
							 <el-button
							 v-else="scope.row.status === '1'"
							   size="mini"
							   type="success"
							  >已审核</el-button>
						  </template>
					    </el-table-column>
						
						
				</el-table>
				
			</div>
		</div>
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="../../plugins/vue/vue.js"></script>
		<!-- 引入组件库 -->
		<script src="../../plugins/element-ui/index.js"></script>
		<!-- 引入axios -->
		<script src="../../plugins/axios/axios.min.js"></script>
		<script src="../../js/request.js"></script>
		<script src="../../api/member.js"></script>
		<script>
			new Vue({
				el: '#member-app',
				data() {
					return {
						
						tableData: [],
						
					}
				},
				
				created() {
					this.init()
					
				},
				
				methods: {
					async init() {
						
						await queryView().then(res => {
							console.log(res)
							if (String(res.code) === '200') {
								for (var i = 0; i < res.data.length; i++) {
									var timeString = res.data[i].startTime;
									var year = timeString.substring(0, 4);
									var month = timeString.substring(4, 6);
									var day = timeString.substring(6, 8);
									var hour = timeString.substring(8, 10);
									var minute = timeString.substring(10, 12);
									var second = timeString.substring(12, 14);

									var formatStartTime = year + "-" + month + "-" + day + " " + hour + ":" +
										minute +
										":" + second;
									res.data[i].startTime = formatStartTime

									var timeString = res.data[i].endTime;
									var year = timeString.substring(0, 4);
									var month = timeString.substring(4, 6);
									var day = timeString.substring(6, 8);
									var hour = timeString.substring(8, 10);
									var minute = timeString.substring(10, 12);
									var second = timeString.substring(12, 14);

									var formatEndTime = year + "-" + month + "-" + day + " " + hour + ":" +
										minute +
										":" + second;
									res.data[i].endTime = formatEndTime
								}

								console.log(res)
								this.tableData = res.data || []
								this.counts = res.data.total
								
							}
						})
					},
					
				
					
				
					
				}
			})
		</script>
	</body>
</html>
